package com.tjetc.mapper;

import com.tjetc.domain.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    @Select("select * from user where phone = #{phone} ")
    User selectByPhone(String phone);

    User selectByPhoneWithPatients(String phone);

    @Select("select * from user where idcard = #{idcard} ")
    User selectByIdCard(String idcard);

    @Select("select name,idcard from user where id = #{id}")
    User SelNameAndIdCardById(Integer id);

    User SelphoneById(Integer id);

    int UpdatephoneById(@Param("id") Integer id, @Param("phone") String phone);


    //根据电话号查询用户id
    @Select("select id from user where phone=#{phone}")
    Integer findUserByPhoen(String phone);
}